<?php

namespace app\common\validate;

class DictValidate extends BaseValidate
{
    protected $rule = [
        'dict_id' => "integer",
        "pid"     => 'integer',
    ];
    /**
     * 验证规则
     */
    protected $field = [
        'id'          => '',
        'pid'         => '表名',
        'data_type'   => '数据类别',
        'data_value'  => '数据编码',
        'data_name'   => '数据名称',
        'sort'        => '排序',
        'status'      => '状态',
        'data_desc'   => '描述',
        'create_time' => '创建时间',
        'update_time' => '更新时间',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'index'  => [],
        'save'   => [
            "pid"        => 'require',
            "data_type"  => "require",
            "data_value" ,
            "data_name"  => "require",
            "sort"       => 'require|integer',
            "status"     => 'require|in:1,2',
        ],
        'update' => [
            'dict_id' => "require",
            "pid"     => "require",
            "data_type",
            "data_value",
            "data_name",
            "sort"    => 'integer',
            "status"  => 'require|in:1,2',
            "data_desc"
        ],
        'delete' => [
            'dict_id'
        ],
        'read'   => [
            'dict_id'
        ]
    ];

    /**
     * 提示消息
     */
    protected $message = [

    ];


}
